{% extends '@AdsPlace/admin.twig' %}

{#内容部分#}
{% block content %}
   <div class="mod12">
       <div class="right-head">
            <el-breadcrumb separator-class="el-icon-arrow-right">
             <el-breadcrumb-item >资源管理</el-breadcrumb-item>
             <el-breadcrumb-item> 媒体站点</el-breadcrumb-item>
           </el-breadcrumb>
       </div>
       <div class="toolbar-btn-action">
           
           <div class="searchBox">
               
                    <el-input placeholder="请输入关键词"
                     v-on:change="onKeywordChange"
                     v-model="keyword" class="input-with-select">
                     
                      <el-button slot="append" icon="el-icon-search"></el-button>
                    </el-input>
                 
           </div>
       {# 功能按钮#}
           <el-button
           @click="OnNewCreateHandler(1)"
            type="primary" icon="el-icon-plus">新建网站</el-button>
           
            <el-button
           @click="OnNewCreateHandler(2)"
            type="primary" icon="el-icon-plus">新建APP应用</el-button>
 
           
       </div>
       {# 这里是新增广告位   #}
       <el-drawer
          ref="newPlaceDrawer"
          title="新增媒体"
          :append-to-body="true"
          :visible.sync="drawerNewPlace"        
          :show-close="true"
          :before-close="handleDrawerClose"
          :wrapper-closable='false'
          :destroy-on-close="true"
          :with-header="true"
          size="85%">
           <div class="formBox" >
              <site-app-form
              :addtype="addtype"
              :idsite="idsite"
              v-on:onclosedrawer="onCloseDrawer"
              ></site-app-form>
           </div>
        </el-drawer>
 
    {# 网站和app的管理列表 #}
       <div class="table-responsive"  v-loading="tableLoading">
            <el-table
                     v-bind:data="tablelist.slice(start, end)"                           
                     border
                      ref="multipleTable"
                       @selection-change="handleSelectionChange"
                     style="width: 100%">
              <el-table-column
                          type="selection"
                          width="55"> 
                  </el-table-column>  

             <el-table-column
                     prop="idsite"
                     label="ID"  width="70" >
                  </el-table-column> 
               <el-table-column
                     prop="main_url"
                     label="网站域名"  width="210" >
                      <template slot-scope="scope">
                        <a>  ${scope.row.main_url|industry}</a>
                     </template>
                  </el-table-column>  

              <el-table-column
                     prop="name"
                     label="网站名称"
                     width="180">
                      <template slot-scope="scope">
                           <p > ${scope.row.name}</p>
                           
                     </template>
                     </el-table-column>
             <el-table-column
                     prop="plat"
                     label="类型" width="90"  >
                     <template slot-scope="scope">
                           <span v-if="scope.row.type=='website'"> 网站</span>
                           <span v-else> APP应用 </span>
                     </template>
                     </el-table-column>
              
               <el-table-column
                     prop="sitesearch_category_parameters"
                     label="行业"   >
                    
                  </el-table-column> 

               
                     
             <el-table-column
                     prop="ts_created"
                     label="创建时间"   >
                     </el-table-column>   
              <el-table-column
                     prop="status"
                     label="状态" width="90"  >
                     </el-table-column>                     
              <el-table-column label="操作">
                        <template slot-scope="scope">
                     <el-button
                           size="mini"
                           type="text"
                           @click="handleEdit(scope.$index, scope.row,'edit')">修改</el-button>
                     <el-button
                           size="mini"
                           type="text"
                           @click="handleEdit(scope.$index, scope.row,'delete')">删除</el-button>
                  <el-button
                           size="mini"
                           type="text"
                           @click="handleEdit(scope.$index, scope.row,'viewport')">报告</el-button>
                        </template>
                     </el-table-column>
                  </el-table>
         </div>
         <div class="pagination" style="margin-left: -10px;">
         <el-pagination
               background
                  :page-size="pageSize"
               @current-change="handleCurrentChange"
               @size-change="handlePageSize"
               :page-sizes="[5,10,20,30,50,70,100]"
                  layout="prev, pager, next,total,jumper,sizes"
                  :total="total" :page-count="total" >
         </el-pagination>
         </div>
   {# table内容 #}
   </div>
{% endblock%}
{# 这里加入需要的vue组件js#}
{% block pagejs %}
 <script src="./plugins/AdsPlace/js/dist/index.js"></script> 
 <script src="./plugins/AdsPlace/js/page/siteapp.js"></script>   
{% endblock%}